home *** CD-ROM | disk | FTP | other *** search
/ Grafik Collection 1 / Grafik Collection 1.iso / hamlabplus_demo / rexx / auto.hl next >
Text File  |  1992-06-26  |  1KB  |  79 lines

  1. /* HamLab Plus AREXX Script
  2.  *
  3.  * This script opens a file, picks a display mode based on the input size,
  4.  * and displays it
  5.  *
  6.  * Ed Hanway
  7.  * 26 June 1992
  8.  */
  9.  
  10. arg fname
  11.  
  12. /* Attempt to open a file */
  13. if fname == "" then do
  14.     'open'
  15. end; else do
  16.     'open filename' fname
  17. end
  18.  
  19.  if rc > 5 then do
  20.      'message "Open problem"'
  21.      exit
  22.  end
  23.  
  24. /* get some info about it */
  25.  
  26. 'GETATTR INPUT STEM INP'
  27.  
  28. if inp.width > 384 then do
  29.     'resolution high lace'
  30. end; else do
  31.     'resolution low lace'
  32. end
  33.  
  34. select
  35.     /* for one bitplane picture, assume black & white */
  36.  
  37.     when inp.depth = 1 then do
  38.         'message "Black & white picture..."'
  39.         'cache24bit mem 0'
  40.         'cache12bit mem 0'
  41.         'dither none'
  42.         'dither2 none'
  43.         'onestep false'
  44.         'bitplanes 1'
  45.         'palmode fixed'
  46.     end
  47.  
  48.     /* probably displayable without lots of analysis */
  49.     when (inp.depth > 1) & (inp.depth <= 4) then do
  50.         'message "Small palette picture..."'
  51.         'cache24bit mem 0'
  52.         'cache12bit mem -1'
  53.         'dither none'
  54.         'dither2 none'
  55.         'onestep false'
  56.         x = inp.depth
  57.         'bitplanes' inp.depth
  58.         'palettemode normal'
  59.     end
  60.  
  61.     otherwise do
  62.         'message "Large palette picture..."'
  63.         'cache24bit mem -1'
  64.         'cache12bit mem 0'
  65.         'dither none'
  66.         'dither2 floyd'
  67.         'onestep true'
  68.         if(inp.width > 384) then do
  69.             'bitplanes 4'
  70.         end; else do
  71.             'bitplanes ham'
  72.         end
  73.         'palettemode normal'
  74.     end
  75. end
  76.  
  77. 'display'
  78.  
  79.